﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VideoCache.Server.MVCWeb.Attributes;

namespace VideoCache.Server.MVCWeb.Areas.Member.Models
{
    public class NetbarRegisterModel
    {
        [Display(Name = "电子邮件")]
        [Required(ErrorMessage = "请输入电子邮件地址。")]
        [Email(ErrorMessage = "电子邮件地址错误，请重新输入。")]
        [Remote("IsEmailAvaliable", "User", "Member", ErrorMessage = "电子邮件地址已存在。")]
        public string Email { get; set; }

        [Display(Name = "密码")]
        [Required(ErrorMessage = "请输入密码。")]
        [StringLength(20, MinimumLength = 6, ErrorMessage = "密码长度在6-20位之间。")]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [Display(Name = "确认密码")]
        [Compare("Password", ErrorMessage = "两次输入的密码不一致。")]
        [DataType(DataType.Password)]
        public string ConfirmPassword { get; set; }

        [Display(Name = "验证码")]
        [VerifyCode(ErrorMessage = "验证码错误。")]
        [Required(ErrorMessage = "请输入验证码。")]
        public string VerifyCode { get; set; }
    }
}